//
//  ItemCateTableViewCell.m
//  礼物go
//
//  Created by dllo on 16/5/27.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ItemCateTableViewCell.h"

@implementation ItemCateTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}


-(void)createSubviews{
    self.nameLabel = [UILabel new];
   // self.nameLabel.text = @"标题";
    [self.contentView addSubview:self.nameLabel];
    self.nameLabel.textAlignment = NSTextAlignmentCenter;
    self.nameLabel.font = [UIFont systemFontOfSize:15];
    
    self.lineView = [UIView new];
    self.lineView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.lineView];

}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.nameLabel.frame = CGRectMake(1, 0, self.contentView.frame.size.width - 1, self.contentView.frame.size.height);
    self.lineView.frame = CGRectMake(0, 0, 1, self.contentView.frame.size.height);
}

-(void)setItemModel:(ItemCategoryModel *)itemModel{
    _itemModel = itemModel;
    self.nameLabel.text = _itemModel.name;
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
